package com.wing.purchase.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.purchase.model.entity.PurQualityTestingTask;
import com.wing.purchase.model.request.QualityDetectionInfoForm;
import com.wing.purchase.model.response.PurQualityTestingTaskDetailVo;

import java.util.Map;

/**
 * 采购订单-质检-Service
 *
 * @author hz
 */
public interface PurQualityTestingTaskService extends IService<PurQualityTestingTask> {

    /**
     * 查询所有的质检任务
     * @param pg 分页参数
     * @param params 参数
     * @return 分页后的质检任务
     */
    IPage<PurQualityTestingTask> pageList4app(Page<PurQualityTestingTask> pg, Map<String, Object> params);

    /**
     * 添加质检任务
     * @param purQualityTestingTask 添加质检任务
     * @return 是否成功添加
     */
    int addQualityTestingTask(PurQualityTestingTask purQualityTestingTask);

    /**
     * 查询质检详情
     * @param taskId 任务id
     * @return 返回质检任务详情信息
     */
    PurQualityTestingTaskDetailVo detail(String taskId);

    /**
     * 认领质检任务
     * @param recordId 任务id
     * @return > 0 成功
     */
    int claim(String recordId);

    /**
     * 我的任务检测
     * @param qualityDetectionInfoForm 检测入参
     * @return 是否成功
     */
    int detection(QualityDetectionInfoForm qualityDetectionInfoForm);
}
